package org.yang.common.core.enums;

import lombok.Getter;


import java.io.Serializable;

/**
 * 返回内容枚举
 *
 * @author: lslands
 * @version: 1.0
 * @create: 2024/5/10
 * @description:
 */
@Getter
public enum REnum implements Serializable {

    /*TODO 请求成功 20** */
    SUCCESS(2000,"成功"),
    CREATE(2001,"创建成功"),
    UPDATE(2002, "更新成功"),
    DELETE(2003, "删除成功"),
    /*TODO 请求失败 40** */
    FAIL(4000,"失败"),
    CREATE_FAIL(40001,"创建失败"),
    UPDATE_FAIL(40002,"更新失败"),
    DELETE_FAIL(40003, "删除失败"),
    CONFLICT_FAIL(4009,"存在重复内容"),
    /*TODO 请求失败 50** */
    ERROR(5000,"服务错误，请联系管理员"),

    ;
    /**
     * 状态码
     */
    private final Integer code;
    /**
     * 返回消息
     */
    private final String message;


    REnum(int code, String message){
        this.code=code;
        this.message= message;
    }
}
